<?php

class MoneyStateBehavior extends CActiveRecordBehavior{

	public $attribute;
	
	public function afterValidate($event) {
		$owner = $this->owner;
		if ($owner->money == $owner->{$this->attribute}) {
			$owner->status = 'ST_FINISHED';
		}
	}
}

?>